home *** CD-ROM | disk | FTP | other *** search
/ .net - The Best of 1999/2000 / netCD Special01.iso / pc / Software / Dreamweaver / dreamw.exe / data1.cab / App_Files / Configuration / Objects / Head / Base.js < prev    next >
Encoding:
JavaScript  |  1999-12-09  |  1.4 KB  |  49 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved.
  2.  
  3.  
  4. //---------------   GLOBAL VARIABLES   ---------------
  5.  
  6. var helpDoc = MM.HELP_objBase;
  7.  
  8.  
  9. //---------------     API FUNCTIONS    ---------------
  10.  
  11. function objectTag(){
  12.   var Form=document.forms[0];
  13.   var Attributes='';
  14.   var href=Form.hrefFileName.value;
  15.   var frameTarget=Form.frameTarget.selectedIndex;
  16.   Attributes+='href="' + href + '" ';
  17.   if (frameTarget!=-1)
  18.     Attributes+='target="' + Form.frameTarget.options[frameTarget].text + '"';
  19.     
  20.   if (Attributes.charAt(Attributes.length-1)==' ') {//if there is an extra space, kill it
  21.     Attributes = Attributes.substring(0,Attributes.length-2);    
  22.   }
  23.             
  24.   return '<base ' + Attributes + '>';
  25. }
  26.  
  27. //---------------    LOCAL FUNCTIONS   ---------------
  28.  
  29. function browseFile(){
  30.   var fileName = browseForFileURL();  //returns a local filename
  31.   if (fileName) document.forms[0].hrefFileName.value = fileName;
  32. }
  33.  
  34. function initializeUI(){
  35.   var frameName,counter,frameList;
  36.   var counter=5;
  37.   frameList=getObjectRefs("NS 4.0","parent","frame"); //get list of frames
  38.   if (frameList && frameList.length>0) { //if frames
  39.     for (i=0; i<frameList.length; i++) {
  40.       if (frameList[i].indexOf('unnamed') == -1){
  41.         frameName=frameList[i].substring(frameList[i].indexOf("['") + 2,frameList[i].indexOf("']"));
  42.         document.forms[0].frameTarget.options[counter++] = new Option(frameName); 
  43.       }
  44.     }
  45.   }
  46. }
  47.  
  48.  
  49.